package com.example.tao_city.text1;

import android.database.DataSetObserver;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Adapter;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.SimpleAdapter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by TAO_CITY on 2018/1/29.
 */

public class Fm1_chongzhijilu extends AppCompatActivity {
    private ImageView back;
    private ListView listView;
    private int[] to={R.id.chongzhijilu_listview_ka,R.id.chongzhijilu_listview_qian,
            R.id.chongzhijilu_listview_shijian,R.id.chongzhijilu_listview_kahao,
            R.id.chongzhijilu_listview_bianhao};
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fm_chongzhijilu);
        initview();
    }

    private void initview() {
        back=findViewById(R.id.chongzhijilu_back);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        listView=findViewById(R.id.chongzhijilu_listview);
        List list=new ArrayList();
        Map map= new HashMap();
        map.put("1","普通卡");
        map.put("2","20元");
        map.put("3","6220035203358");
        map.put("4","2018-01-29 10:41:53");
        map.put("5","100005030174551554552");
        list.add(map);
       String[] a={"1","2","3","4","5"};
        SimpleAdapter sa=new SimpleAdapter(this,list,R.layout.chongzhijilu_listview,a,to);
        listView.setAdapter(sa);
    }
}
